package com.zusmart.base.network.support;

import com.zusmart.base.network.ChannelOption;

public class DefaultChannelOption implements ChannelOption {

	private int backLog = 256;
	private int soTimeout = 0;
	private int bufferSize = 8192;
	private int connectTimeout = 5 * 1000;
	private boolean directBuffer = false;
	private boolean reuseAddress = true;
	private boolean tcpNoDelay = true;
	private boolean tcpKeepAlive = true;
	private int nioSelectorSize = Runtime.getRuntime().availableProcessors();
	private String nioSelectorName = "selector";
	private String nioAcceptorName = "accpetor";

	@Override
	public int getBackLog() {
		return this.backLog;
	}

	@Override
	public int getSoTimeout() {
		return this.soTimeout;
	}

	@Override
	public int getBufferSize() {
		return this.bufferSize;
	}

	@Override
	public boolean isDirectBuffer() {
		return this.directBuffer;
	}

	@Override
	public boolean isReuseAddress() {
		return this.reuseAddress;
	}

	@Override
	public int getNioSelectorSize() {
		return this.nioSelectorSize;
	}

	@Override
	public String getNioAcceptorName() {
		return this.nioAcceptorName;
	}

	@Override
	public String getNioSelectorName() {
		return this.nioSelectorName;
	}

	@Override
	public boolean isTcpNoDelay() {
		return this.tcpNoDelay;
	}

	@Override
	public boolean isTcpKeepAlive() {
		return this.tcpKeepAlive;
	}

	@Override
	public int getConnectTimeout() {
		return this.connectTimeout;
	}

}